<j:ebuttons
  [searchPlaceholder]="'BasicArchives::UI:SimplyEntity.JButtons.SearchPlaceholder' | abpLocalization"
  [editState]="editState"
  [submitBtnVisible]="false"
  [backBtnVisible]="false"
  [approveBtnVisible]="false"
  [unapproveBtnVisible]="false"
  [approveDividerVisible]="false"
  [selectBtnVisible]="false"
  [listBtnVisible]="false"
  [searchDividerVisible]="false"
  [saveBtnDisabledFn]="isSaveBtnDisabled"
  (saveBtnClick)="save()"
  (giveupBtnClick)="giveup()"
  (newBtnClick)="new()"
  (copyBtnClick)="copy()"
  (deleteBtnClick)="delete()"
  (refreshBtnClick)="refresh()"
  (searchBtnClick)="search($event)"
>
</j:ebuttons>

<nz-card class="main-card">
  <form nz-form [formGroup]="validateForm">
    <nz-tabset nzType="card">
      <nz-tab [nzTitle]="'BasicArchives::UI:SimplyEntity.CardTitle.Base' | abpLocalization">
        <div nz-row>
          <div nz-col [nzSpan]="8">
            <nz-form-item>
              <nz-form-label [nzSm]="8" [nzXs]="24" [nzRequired]="!codeInputDisabled" nzFor="code">
                <a nz-button nzType="link" class="ref-form-label" (click)="uniqueCodeSetting()">
                  {{ 'BasicArchives::ModelTitle:Joy.Erp.BasicArchives.Customers.Customer.Code' | abpLocalization }}
                </a>
              </nz-form-label>
              <nz-form-control [nzSm]="14" [nzXs]="24" nzHasFeedback>
                <input
                  nz-input
                  id="code"
                  formControlName="code"
                  [placeholder]="'BasicArchives::ModelPlaceHolder:Joy.Erp.BasicArchives.Customers.Customer.Code' | abpLocalization"
                  [readonly]="codeInputDisabled"
                  [ngClass]="{ 'input-disabled': codeInputDisabled }"
                  nz-tooltip
                  [nzTooltipTitle]="getErrorMessage('code')"
                  [nzTooltipVisible]="validateForm.get('code')?.invalid && validateForm.get('code')?.touched"
                  nzTooltipPlacement="top"
                />
              </nz-form-control>
            </nz-form-item>
          </div>          
          <div nz-col [nzSpan]="8">
            <nz-form-item>
              <nz-form-label [nzSm]="8" [nzXs]="24" nzRequired nzFor="customerTypeId">
                {{ 'BasicArchives::ModelTitle:Joy.Erp.BasicArchives.Customers.Customer.CustomerTypeId' | abpLocalization }} 
              </nz-form-label>
              <nz-form-control [nzSm]="14" [nzXs]="24" nzHasFeedback>
                <nz-tree-select
                  id="customerTypeId"
                  formControlName="customerTypeId"
                  [nzPlaceHolder]="'BasicArchives::ModelPlaceHolder:Joy.Erp.BasicArchives.Customers.Customer.CustomerTypeId' | abpLocalization"
                  [nzNodes]="customerTypeTreeData"
                  [nzShowSearch]="true"
                  [nzAllowClear]="true"
                  [nzDropdownStyle]="{ maxHeight: '300px', overflow: 'auto' }"
                  nz-tooltip
                  [nzTooltipTitle]="getErrorMessage('customerTypeId')"
                  [nzTooltipVisible]="validateForm.get('customerTypeId')?.invalid && validateForm.get('customerTypeId')?.touched"
                  nzTooltipPlacement="top"
                >
                </nz-tree-select>
              </nz-form-control>
            </nz-form-item>
          </div>
          <div nz-col [nzSpan]="8">
          </div>
          <div nz-col [nzSpan]="8">
            <nz-form-item>
              <nz-form-label [nzSm]="8" [nzXs]="24" nzRequired nzFor="name">
                {{ 'BasicArchives::ModelTitle:Joy.Erp.BasicArchives.Customers.Customer.Name' | abpLocalization }} 
              </nz-form-label>
              <nz-form-control [nzSm]="14" [nzXs]="24" nzHasFeedback>
                <input
                  nz-input
                  id="name"
                  formControlName="name"
                  [placeholder]="'BasicArchives::ModelPlaceHolder:Joy.Erp.BasicArchives.Customers.Customer.Name' | abpLocalization"
                  nz-tooltip
                  [nzTooltipTitle]="getErrorMessage('name')"
                  [nzTooltipVisible]="validateForm.get('name')?.invalid && validateForm.get('name')?.touched"
                  nzTooltipPlacement="top"
                />
              </nz-form-control>
            </nz-form-item>
          </div>
          <div nz-col [nzSpan]="8">
            <nz-form-item>
              <nz-form-label [nzSm]="8" [nzXs]="24" nzFor="shortName">
                {{ 'BasicArchives::ModelTitle:Joy.Erp.BasicArchives.Customers.Customer.ShortName' | abpLocalization }} 
              </nz-form-label>
              <nz-form-control [nzSm]="14" [nzXs]="24" nzHasFeedback>
                <input
                  nz-input
                  id="shortName"
                  formControlName="shortName"
                  [placeholder]="'BasicArchives::ModelPlaceHolder:Joy.Erp.BasicArchives.Customers.Customer.ShortName' | abpLocalization"
                  nz-tooltip
                  [nzTooltipTitle]="getErrorMessage('shortName')"
                  [nzTooltipVisible]="validateForm.get('shortName')?.invalid && validateForm.get('shortName')?.touched"
                  nzTooltipPlacement="top"
                />
              </nz-form-control>
            </nz-form-item>
          </div>          
          <div nz-col [nzSpan]="8"></div>
          <div nz-col [nzSpan]="8">
            <nz-form-item>
              <nz-form-label [nzSm]="8" [nzXs]="24" nzFor="operatorId">
                {{ 'BasicArchives::ModelTitle:Joy.Erp.BasicArchives.Customers.Customer.OperatorId' | abpLocalization }} 
              </nz-form-label>
              <nz-form-control [nzSm]="14" [nzXs]="24" nzHasFeedback>
                <widget-entity-ref-select
                  id="operatorId"
                  formControlName="operatorId"
                  [placeholder]="'BasicArchives::ModelPlaceHolder:Joy.Erp.BasicArchives.Customers.Customer.OperatorId' | abpLocalization"
                  [idKey]="'id'"
                  [labelKey]="'name'"
                  [showSelect]="showOperatorSelect"
                  [getDetail]="getOperatorDetail"
                  nz-tooltip
                  [nzTooltipTitle]="getErrorMessage('operatorId')"
                  [nzTooltipVisible]="validateForm.get('operatorId')?.invalid && validateForm.get('operatorId')?.touched"
                  nzTooltipPlacement="top"
                >
                </widget-entity-ref-select>
              </nz-form-control>
            </nz-form-item>
          </div>          
          <div nz-col [nzSpan]="8"></div>
          <div nz-col [nzSpan]="8"></div>
          <nz-divider></nz-divider>
          <div nz-col [nzSpan]="8">
            <nz-form-item>
              <nz-form-label [nzSm]="8" [nzXs]="24" nzFor="contact">
                {{ 'BasicArchives::ModelTitle:Joy.Erp.BasicArchives.Customers.Customer.Contact' | abpLocalization }} 
              </nz-form-label>
              <nz-form-control [nzSm]="14" [nzXs]="24" nzHasFeedback>
                <input
                  nz-input
                  id="contact"
                  formControlName="contact"
                  [placeholder]="'BasicArchives::ModelPlaceHolder:Joy.Erp.BasicArchives.Customers.Customer.Contact' | abpLocalization"
                  nz-tooltip
                  [nzTooltipTitle]="getErrorMessage('contact')"
                  [nzTooltipVisible]="validateForm.get('contact')?.invalid && validateForm.get('contact')?.touched"
                  nzTooltipPlacement="top"
                />
              </nz-form-control>
            </nz-form-item>
          </div>
          <div nz-col [nzSpan]="8">
            <nz-form-item>
              <nz-form-label [nzSm]="8" [nzXs]="24" nzFor="phone">
                {{ 'BasicArchives::ModelTitle:Joy.Erp.BasicArchives.Customers.Customer.Phone' | abpLocalization }} 
              </nz-form-label>
              <nz-form-control [nzSm]="14" [nzXs]="24" nzHasFeedback>
                <input
                  nz-input
                  id="phone"
                  formControlName="phone"
                  [placeholder]="'BasicArchives::ModelPlaceHolder:Joy.Erp.BasicArchives.Customers.Customer.Phone' | abpLocalization"
                  nz-tooltip
                  [nzTooltipTitle]="getErrorMessage('phone')"
                  [nzTooltipVisible]="validateForm.get('phone')?.invalid && validateForm.get('phone')?.touched"
                  nzTooltipPlacement="top"
                />
              </nz-form-control>
            </nz-form-item>
          </div><div nz-col [nzSpan]="8">
            <nz-form-item>
              <nz-form-label [nzSm]="8" [nzXs]="24" nzFor="address">
                {{ 'BasicArchives::ModelTitle:Joy.Erp.BasicArchives.Customers.Customer.Address' | abpLocalization }} 
              </nz-form-label>
              <nz-form-control [nzSm]="14" [nzXs]="24" nzHasFeedback>
                <textarea
                  nz-input
                  id="address"
                  formControlName="address"
                  [placeholder]="'BasicArchives::ModelPlaceHolder:Joy.Erp.BasicArchives.Customers.Customer.Address' | abpLocalization"
                  [nzAutosize]="{ minRows: 3, maxRows: 5 }"
                  nz-tooltip
                  [nzTooltipTitle]="getErrorMessage('address')"
                  [nzTooltipVisible]="validateForm.get('address')?.invalid && validateForm.get('address')?.touched"
                  nzTooltipPlacement="top"
                >
                </textarea>
              </nz-form-control>
            </nz-form-item>
          </div>          
          <nz-divider></nz-divider>
          <div nz-col [nzSpan]="8">
            <nz-form-item>
              <nz-form-label [nzSm]="8" [nzXs]="24" nzFor="enabled">
                {{ 'BasicArchives::ModelTitle:Joy.Erp.BasicArchives.Customers.Customer.Enabled' | abpLocalization }} 
              </nz-form-label>
              <nz-form-control [nzSm]="14" [nzXs]="24" nzHasFeedback>
                <nz-switch
                  id="enabled"
                  formControlName="enabled"
                  nz-tooltip
                  [nzTooltipTitle]="getErrorMessage('enabled')"
                  [nzTooltipVisible]="validateForm.get('enabled')?.invalid && validateForm.get('enabled')?.touched"
                  nzTooltipPlacement="top"
                >
                </nz-switch>
              </nz-form-control>
            </nz-form-item>
          </div>
          
        </div>
      </nz-tab>
    </nz-tabset>
  </form>

</nz-card> 